local FightInterface = require("gameLogic.fightSkill.sequence.FightInterface")
local FightCallback = class("FightCallback", FightInterface)

function FightCallback:ctor(callback, param)
    self._callback = callback
    self._param = param
    FightCallback.super.ctor(self)
end

function FightCallback:_update()
    if self._sequence then
        return
    end
    local time = self._callback(self._param)
    if not time then
        time = 0
    end
    self._sequence = DOTween.Sequence()
    self._sequence:AppendInterval(time)
    self._sequence:AppendCallback(
        function()
            self._isDone = true
        end
    )
end

return FightCallback
